import Vue from 'vue'
import Router from 'vue-router'
import Home from '@/view/Home'


Vue.use(Router)

export default new Router({

  mode: 'history',
  routes: [
    //测试专用
    {path:'/cs',
      component:()=>import('@/components/cs')},
    {
      path: '/',
      name: 'index',
      redirect: '/login'
    },
    {
      path: '/login',
      name: 'Login',
      component: () => import('@/view/Login')
    }, //定义访问页面的路由地址
    {
      path: '/home',
      name: 'Home',
      component: Home,
      redirect: '/welcome',
      children: [
        {
          /**
           * @description  欢迎页(主页)
           */
          path: '/welcome',
          component: () => import('@/components/Welcome')
        },
        /**
         * @description  权限列表页
         */
        {
          path: '/acl/list',
          component: () => import('@/view/acl/List')
        },
        /**
         * @description  权限分配页
         */
        {
          path: '/acl/add',
          component: () => import('@/view/acl/Add')
        },

        /**
         * @description  数据分析页
         */
        {
          path: '/sta/show',
          component: () => import('@/view/sta/Count')
        },
        /**
         * @description 航班列表 及系列操作
         */
        {//普通
          path: '/plane/list/base',
          component: () => import('@/view/plane/list/Base')
        },

        {//转程
          path: '/plane/list/transfer',
          component: () => import('@/view/plane/list/Transfer')
        },

        {//多程
          path: '/plane/list/connecting',
          component: () => import('@/view/plane/list/Connecting')
        },
        /**
         * @description 航班添加
         * 保存操作：/plane/save
         * 修改操作： /plane/edit
         */
        {
          path:'/plane/save/base',
          component:()=>import('@/view/plane/saveOrUpdate/BaseSave')
        },
        {
          path: '/plane/edit/base/:id',
          component:()=>import('@/view/plane/saveOrUpdate/BaseSave'),
          hidden: true
        },

        {
          path:'/plane/save/transfer',
          component:()=>import('@/view/plane/saveOrUpdate/TransferSave')
        },
        {
          path: '/plane/edit/transfer/:id',
          component:()=>import('@/view/plane/saveOrUpdate/TransferSave'),
          hidden: true
        },

        {
          path:'/plane/save/connecting',
          component:()=>import('@/view/plane/saveOrUpdate/ConnectingSave')
        },
        {
          path: '/plane/edit/connecting/:id',
          component:()=>import('@/view/plane/saveOrUpdate/ConnectingSave'),
          meta: { title: '编辑联程航班', noCache: true },
          hidden: true
        },
        /**
         * 用户列表
         * 管理员
         * 普通用户
         */
        {
         path:'/user/list',
          component:()=>import('@/view/user/UserList')
        },
        {
          path:'/admin/list',
          component:()=>import('@/view/user/AdminList')
        },

        /**
         * @description 用户添加
         * 保存操作：/user/save
         * 修改操作： /user/edit
         */

        {
          path:'/user/save',
          component:()=>import('@/view/user/UserSave')
        },

        {
          path: '/user/edit/user/:id',
          component:()=>import('@/view/user/UserSave'),
          hidden: true
        },

        {
          path:'/admin/save',
          component:()=>import('@/view/user/AdminSave')
        },
        {
          path: '/admin/edit/admin/:id',
          component:()=>import('@/view/user/AdminSave'),
          hidden: true
        },
        /**
         * 订单管理
         */
        {
          path:'/order/list',
        component:()=>import('@/view/order/OrderList')
        },

        {
          path:'/order/logList',
          component:()=>import('@/view/order/LogList')
        },
        /**
         * 接口管理
         */
        {
          path: '/swagger/plane',
          component: () => import('@/view/admin/PlaneApplication'),
        },
        {
          path: '/Swagger/user',
          component: () => import('@/view/admin/UserApplication'),
        },
        {
          path: '/swagger/upload',
          component: () => import('@/view/admin/UploadApplication'),
        },
        {
          path: '/swagger/sms',
          component: () => import('@/view/admin/TxSmsApplication'),
        },
        {
          path: '/swagger/order',
          component: () => import('@/view/admin/OrderApplication'),
        },
        {
          path: '/swagger/acl',
          component: () => import('@/view/admin/AclApplication'),
        },
        /**
         * 进程管理 (SpringAdmin+Hystrix)
         */
        {
          path: '/admin/boss',
          component: () => import('@/view/admin/SpringAdmin'),
        },



      ]
    }
  ]

}

)

